import request from '@/utils/request';

/***************** 资源申请-公司 */

// 个号信息价格提示
export function getFbPriceTip() {
  return request({
    url: '/company/fb_account_type/get_prices',
    method: 'get'
  });
}

// 获取申请表单
export function companyApplicationForm(data) {
  return request({
    url: '/company/application/form',
    method: 'post',
    data,
    headers: { repeatSubmit: false }
  });
}

// 获取详情表单
export function companyApplicationForm_detail(data) {
  return request({
    url: '/company/application/form_detail',
    method: 'get',
    params: data,
    headers: { repeatSubmit: false }
  });
}

// 获取申请表单的值列表
export function companyApplicationForm_value(data) {
  return request({
    url: '/company/application/form_value',
    method: 'get',
    params: data,
    headers: { repeatSubmit: false }
  });
}

// 批量申请资源-公司
export function companyApplicationBatchApply(data) {
  return request({
    url: '/company/application/batch/apply',
    method: 'post',
    data
  });
}

// 申请资源-公司
export function companyApplicationApply(data) {
  return request({
    url: '/company/application/apply',
    method: 'post',
    data
  });
}

// 取消申请-公司
export function companyApplicationCancel(data) {
  return request({
    url: '/company/application/cancel',
    method: 'post',
    data
  });
}

// 获取申请详情-公司
export function companyApplicationDetail(params) {
  return request({
    url: '/company/application/detail',
    method: 'get',
    params
  });
}

// 分页列出申请-公司
export function companyApplicationList(data) {
  return request({
    url: '/company/application/list',
    method: 'post',
    data
  });
}

// 重新申请-公司
export function companyApplicationReapply(data) {
  return request({
    url: '/company/application/reapply',
    method: 'post',
    data
  });
}

// 获取站点资源详情-公司
export function companyResourceDomainDetail(data) {
  return request({
    url: '/company/resource/domain/detail',
    method: 'get',
    params: data
  });
}

// 获取站点资源详情-处理结果-公司
export function companyApplicationHandleDetail(data) {
  return request({
    url: '/company/application/handle_detail',
    method: 'get',
    params: data
  });
}

/***************** 资源申请-平台 */

// 接受申请-平台
export function platformApplicationAccept(data) {
  return request({
    url: '/platform/application/accept',
    method: 'post',
    data
  });
}

// 完成申请-平台
export function platformApplicationComplete(data) {
  return request({
    url: '/platform/application/complete',
    method: 'post',
    data
  });
}

// 获取申请详情-平台
export function platformApplicationDetail(params) {
  return request({
    url: '/platform/application/detail',
    method: 'get',
    params
  });
}

// 导出申请-平台
export function platformApplicationExport(data) {
  return request({
    url: '/platform/application/export',
    method: 'post',
    data
  });
}

// 分页列出申请-平台
export function platformApplicationList(data) {
  return request({
    url: '/platform/application/domain/list',
    method: 'post',
    data
  });
}

// 驳回申请-平台
export function platformApplicationReject(data) {
  return request({
    url: '/platform/application/reject',
    method: 'post',
    data
  });
}

/***************** 站点资源-平台 */

// 新建站点资源-平台
export function platformResourceDomainNew(data) {
  return request({
    url: '/platform/resource/domain/new',
    method: 'post',
    data
  });
}

// 列出站点资源
export function companyResourceDomainList(data) {
  return request({
    url: '/company/resource/domain/list',
    method: 'post',
    headers: { repeatSubmit: false },
    data
  });
}

// 弃用站点资源
export function platformResourceDomainAbandoned(data) {
  return request({
    url: '/platform/resource/domain/abandoned',
    method: 'post',
    data
  });
}

// 列出弃用投放站点记录列表
export function platformResourceDomainAbandonedList(data) {
  return request({
    url: '/platform/resource/domain/abandoned/list',
    method: 'post',
    data
  });
}

// 导出弃用投放站点记录列表
export function platformResourceDomainAbandonedExport(data) {
  return request({
    url: '/platform/resource/domain/abandoned/export',
    method: 'post',
    data
  });
}

// 导出站点资源-平台
export function companyResourceDomainExport(data) {
  return request({
    url: '/company/resource/domain/export',
    method: 'post',
    data
  });
}

// 更新站点资源-平台
export function companyResourceDomainUpdate(data) {
  return request({
    url: '/company/resource/domain/update',
    method: 'post',
    data
  });
}

// 列出站点维护记录-平台
export function platformResourceDomainRecordList(data) {
  return request({
    url: '/platform/resource/domain/record/list',
    method: 'post',
    data
  });
}

// 导出站点资源维护记录-平台
export function platformResourceDomainRecordExport(data) {
  return request({
    url: '/platform/resource/domain/record/export',
    method: 'post',
    data
  });
}

/***************** 域名 */

// 获取域名
export function platformDomainUsageDomains(params) {
  params.size = params.size || 20;
  return request({
    url: '/platform/domain_usage/domains',
    method: 'get',
    params
  });
}

/***************** FB个号维护历史 */

// 列出fb个号资源维护历史
export function platformResourceFb_accountRecordList(data) {
  return request({
    url: '/platform/resource/fb_account/record/list',
    method: 'post',
    data
  });
}

// 导出fb个号资源维护历史
export function PlatformResourceFb_accountRecordExport(data) {
  return request({
    url: '/platform/resource/fb_account/record/export',
    method: 'post',
    data
  });
}

/***************** FB个号管理 */

// 列出fb个号资源
export function companyResourceFb_accountList(data) {
  return request({
    url: '/company/resource/fb_account/list',
    method: 'post',
    data
  });
}

// 导出fb个号资源
export function companyResourceFb_accountExport(data) {
  return request({
    url: '/company/resource/fb_account/export',
    method: 'post',
    data
  });
}

// 领取fb个号
export function companyResourceFb_accountReceive(data) {
  return request({
    url: '/company/resource/fb_account/receive',
    method: 'post',
    data
  });
}

// 弃用fb个号
export function companyResourceFb_accountUpdate(data) {
  return request({
    url: '/company/resource/fb_account/deprecated',
    method: 'post',
    data
  });
}

// 二步验证fb个号
export function companyResourceFb_accountVerity(data) {
  return request({
    url: '/company/resource/fb_account/verify',
    method: 'get',
    params: data
  });
}

// 更新token
export function companyResourceFb_accountUpdate_token(data) {
  return request({
    url: '/company/resource/fb_account/update_token',
    method: 'put',
    data
  });
}

// 获取详情
export function companyResourceFb_accountDetail(data) {
  return request({
    url: '/company/resource/fb_account/detail',
    method: 'get',
    params: data
  });
}

// 更新个号邮箱密码
export function companyResourceFb_accountUpdate_put(data) {
  return request({
    url: '/company/resource/fb_account/update',
    method: 'put',
    data
  });
}

// 检查FB个号token状态
export function companyResourceFb_accountCheck_current_token(data) {
  return request({
    url: '/company/resource/fb_account/check_current_token',
    method: 'get',
    params: data
  });
}

// 查看FB个号邮箱
export function companyResourceFb_accountGet_email(data) {
  return request({
    url: '/company/resource/fb_account/get_email',
    method: 'get',
    timeout: 60000,
    params: data
  });
}

/***************** FB资源申请处理 */

// 分页列出FB资源申请
export function platformApplicationFb_accountList(data) {
  return request({
    url: '/platform/application/fb_account/list',
    method: 'post',
    data
  });
}

// FB资源申请详情
export function platformApplicationFb_accountDetail(data) {
  return request({
    url: '/platform/application/fb_account/detail',
    method: 'get',
    params: data
  });
}

// 分配个号
export function platformApplicationFb_accountAssign_account(data) {
  return request({
    url: '/platform/application/fb_account/assign_account',
    method: 'post',
    data
  });
}

/***************** FB广告账户管理 */

// fb广告账户列表
export function companyResourceFbAdvActList(data) {
  return request({
    url: '/company/resource/fb_adv_act/list',
    method: 'post',
    data
  });
}

// 导出fb广告账户资源
export function companyResourceFbAdvActExport(data) {
  return request({
    url: '/company/resource/fb_adv_act/export',
    method: 'post',
    data
  });
}

// 列出fb广告账户状态
export function companyResourceFbAdvActStatus(data) {
  return request({
    url: '/company/resource/fb_adv_act/status',
    method: 'get',
    params: data
  });
}

// fb广告账户详情
export function companyResourceFbAdvActDetail(data) {
  return request({
    url: '/company/resource/fb_adv_act/detail',
    method: 'get',
    params: data
  });
}

// 更新内容
export function companyResourceFbAdvActUpdate(data) {
  return request({
    url: '/company/resource/fb_adv_act/update',
    method: 'put',
    data
  });
}

// 批量清零/弃用
export function resourceFbAdvActBatchApplyDetail(data) {
  return request({
    url: '/company/resource/fb_adv_act/batch_apply/detail',
    method: 'post',
    data
  });
}

/***************** 站点资源 */

//批量续费
export function resourceDomainBatchApplyDetail(data) {
  return request({
    url: '/company/resource/domain/batch_apply/detail',
    method: 'post',
    data
  });
}
